package com.heima.user.controller;

import com.heima.model.common.dtos.AuthDto;
import com.heima.model.common.dtos.ResponseResult;
import com.heima.user.service.AuthorService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author [二次元改变世界]
 * 创建时间：🎵 2024/8/1  8:48  星期四
 * 项目名称: 💖 adminProject
 * 包名: 💗 com.heima.admin.controller
 */

/**
 * 用户审核
 */
@RestController
@RequestMapping("/api/v1/auth")
public class AdminAuthorController {

    @Autowired
    private AuthorService authorService;

    /**
     * 查询列表
     *
     * @return
     */
    @PostMapping("/list")
    public ResponseResult list(@RequestBody AuthDto dto) {
        return authorService.listQuery(dto);
    }

    /**
     * 审核失败
     *
     * @return
     */
    @PostMapping("/authFail")
    public ResponseResult authFail(@RequestBody AuthDto dto) {
        return authorService.authFail(dto);
    }

    /**
     * 审核成功
     *
     * @return
     */
    @PostMapping("/authPass")
    public ResponseResult authPass(@RequestBody AuthDto dto) {
        return authorService.authPass(dto);
    }
}
